package com.wise.service.portal.content.webindustryinformationcolumns;

import com.wise.entities.content.IndustryInformationColumn;
import com.wise.entities.content.SuccessArticleColumn;
import com.wise.framework.dao.SqlSelect;
import com.wise.framework.daomodel.DaoList;
import com.wise.model.content.enums.ArticleColumnShowStatus;
import com.wise.summer.v1.portal.content.websuccesscolumns.ListWebSuccessColumns;
import org.springframework.stereotype.Service;
import org.summerframework.model.SummerService;
import org.summerframework.model.SummerServiceBean;
import com.wise.summer.v1.portal.content.webindustryinformationcolumns.ListWebIndustryInformationColumns;

import java.util.List;

@Service
@SummerService
public class ListWebIndustryInformationColumnsService implements SummerServiceBean<ListWebIndustryInformationColumns> {
	@Override
	public void sum(ListWebIndustryInformationColumns model) {
		SqlSelect sql = SqlSelect.selec("*")
				.fromClassName(IndustryInformationColumn.class)
				.eq(IndustryInformationColumn._showState, ArticleColumnShowStatus.SHOW.value())
				.eqLang(IndustryInformationColumn._lang)
				.order_by(IndustryInformationColumn._sort)
				.order_by(IndustryInformationColumn._id + " desc");
		List<ListWebIndustryInformationColumns.Result> articleColumnList = DaoList.s(ListWebIndustryInformationColumns.Result.class, sql);
		model.setSummerResult(articleColumnList);
	}
}
